package com.ssy.lingxi.platform.manage.repository;


import com.ssy.lingxi.platform.manage.entity.content.ContentColumn;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ContentColumnRepository extends JpaRepository<ContentColumn, Long>, JpaSpecificationExecutor<ContentColumn> {

    List<ContentColumn> findAllByStatusAndType(Integer status, Integer type, Sort sort);

    boolean existsBySortAndType(Integer sort, Integer type);

    ContentColumn findBySortAndType(Integer sort, Integer type);

    List<ContentColumn> findAllByStatusAndType(Integer code, Integer type);

    List<ContentColumn> findAllByStatus(Integer status, Sort sort);

    List<ContentColumn> findAllByNameContainingAndStatus(String name, Integer status);
}
